/* 视频通话组件样式 */
.video-call-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.video-call-container {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 20px;
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  max-height: 800px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.video-call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-details h3 {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.call-duration {
  color: #a1a1aa;
  font-size: 14px;
  margin: 0;
}

.close-button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #a1a1aa;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.error-message {
  background: #ef4444;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-message::before {
  content: '⚠️';
  font-size: 16px;
}

.video-container {
  flex: 1;
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  min-height: 400px;
}

.remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1a1a1a;
}

.local-video-container {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 200px;
  height: 150px;
  background: #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.local-video-container:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1a1a1a;
}

.connecting-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.connecting-content {
  text-align: center;
  color: white;
}

.connecting-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.connecting-text {
  font-size: 16px;
  font-weight: 500;
}

.incoming-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.incoming-content {
  text-align: center;
  color: white;
  max-width: 400px;
  padding: 40px;
}

.incoming-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: incomingPulse 2s ease-in-out infinite;
}

@keyframes incomingPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  }
}

.incoming-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.incoming-call-text {
  font-size: 20px;
  color: #a1a1aa;
  margin-bottom: 40px;
  font-weight: 500;
}

.incoming-controls {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.control-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  font-size: 20px;
}

.control-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.control-button:hover::before {
  width: 100%;
  height: 100%;
}

.control-button:hover {
  transform: scale(1.1);
}

.control-button:active {
  transform: scale(0.95);
}

/* 静音按钮 */
.mute-button {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
}

.mute-button.muted {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.mute-button:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
}

.mute-button.muted:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* 视频按钮 */
.video-button {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
}

.video-button.disabled {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.video-button:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
}

.video-button.disabled:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* 挂断按钮 */
.hangup-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.hangup-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* 接听按钮 */
.accept-button {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: white;
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.accept-button:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

/* 拒绝按钮 */
.reject-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.reject-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .video-call-container {
    width: 95vw;
    height: 85vh;
    padding: 16px;
  }

  .local-video-container {
    width: 120px;
    height: 90px;
    top: 12px;
    right: 12px;
  }

  .incoming-avatar {
    width: 100px;
    height: 100px;
  }

  .incoming-name {
    font-size: 24px;
  }

  .incoming-call-text {
    font-size: 18px;
  }

  .control-button {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .accept-button,
  .reject-button {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .video-call-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 12px;
  }

  .local-video-container {
    width: 100px;
    height: 75px;
  }

  .incoming-content {
    padding: 20px;
  }

  .incoming-avatar {
    width: 80px;
    height: 80px;
  }

  .incoming-name {
    font-size: 20px;
  }

  .incoming-call-text {
    font-size: 16px;
  }

  .control-buttons {
    gap: 16px;
  }

  .incoming-controls {
    gap: 20px;
  }
}

/* 视频质量指示器 */
.video-quality {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 5;
}

/* 网络状态指示器 */
.network-status {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 5;
}

.network-status.good {
  background: rgba(34, 197, 94, 0.8);
}

.network-status.poor {
  background: rgba(245, 158, 11, 0.8);
}

.network-status.bad {
  background: rgba(239, 68, 68, 0.8);
}
